home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2010 Summer - Disc 1 / WN_Ete2010_CD1.iso / Onglet5 / Weezo / Weezo setup.exe / {code_appDir} / www / themes / themePreviewBody.php < prev    next >
PHP Script  |  2010-05-19  |  5KB  |  103 lines

  1. <?php
  2.  
  3. /**
  4.  * @return string : HTML code
  5.  * @param string $themeLevel : 'general', 'user', 'resource'
  6.  * @param boolead $targetParentFrame : true if form is submited in parent frame (/index.php)
  7.  * @desc return HTML code for theme selection for given level, through included POST form
  8. */
  9. function themeSelectionControl($theme){
  10.     $dir=cfAppDocRoot().'/themes';
  11.     // Form
  12.     $output= '<form action="themePreview.php" target="_parent" method="GET" enctype="multipart/form-data" name="themeForm" style="display:inline"'.">\n";
  13.  
  14.     // icon
  15.     $output .= outImage(outIcon('theme'),false, false,'margin-right:0.5em;vertical-align:bottom');
  16.     // Label
  17.     $output .= '<span style="margin-right:1em;">'.cfCaption('genTheme').'</span>';
  18.     $themes=cfMGetVar('weezoThemes');
  19.     // Select
  20.     $output .= '<select class="smallFont" name="theme" id="themeSelect" size="1" onChange="document.themeForm.submit()">';
  21.  
  22.     foreach ($themes as $key=>$value) if(!isset($value['private'])){
  23.         if($key==$theme) $output .= '<option selected value="'.cfUTF8Encode($key).'">'.cfUTF8Encode($key).'</option>';
  24.         else $output .= '<option value="'.cfUTF8Encode($key).'">'.cfUTF8Encode($key).'</option>';
  25.     }
  26.     $output .= '</select>';
  27.     $output.='</form>';
  28.     return $output;
  29. }
  30.  
  31. if(!isset($_GET['theme'])) exit;
  32.  
  33.     require(INCLUDE_DIR.'outputFunctions.php');
  34.  
  35.     echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'."\n";
  36.     echo '<HTML><HEAD>'."\n";
  37.     // No cache
  38.     //echo '<meta http-equiv="expires" content="0">'."\n";
  39.     // Charset
  40.     echo '<meta http-equiv="content-type" content="text/html; charset=utf-8">'."\n";
  41.     // Title
  42.     echo '<TITLE>'.$_GET['theme'].'</TITLE>'."\n";
  43.     // Load theme :
  44.     echo '<link rel="stylesheet" type="text/css" href="'.cfUTF8Encode("/themes/".$_GET['theme'].'/theme.css')."\">\n";
  45.     // Load describer.ini information
  46.     $author=false; $authorURL=false;
  47.     if(file_exists(cfAppDocRoot().'/themes/'.$_GET['theme'].'/describer.ini')){
  48.         $describerData=cfParse_ini_file(cfAppDocRoot().'/themes/'.$_GET['theme'].'/describer.ini');
  49.         if(isset($describerData['author'])) $author=$describerData['author'];
  50.         if(isset($describerData['authorURL'])) $authorURL=$describerData['authorURL'];
  51.     }
  52.     // javascript
  53.     echo cfScriptLink('common.js');
  54.     echo '</head><body>';
  55.     $gr=outButton("Button",'#',outIcon('logoSmall'),'toolTip');
  56.     $tx=outButton("Button",'#',false,'toolTip');
  57.  
  58.     // Shadowed frame1
  59.     outShadowBefore("100%");
  60.     echo outDivFrame('frame1');
  61.     echo outFrameHeaderTable('frame1Header',$gr.$_GET['theme'].' theme',$tx);
  62.     if($author) echo '<b>Author: '.cfUTF8Encode($author).'</b><br>';
  63.     if($authorURL) echo outButton(cfUTF8Encode($authorURL),$authorURL).'<br>';
  64.     echo 'This is a sample page for '.$_GET['theme'].' theme'.outButton('Button',false,false,false,false,'style="margin-left:1em"').'<br>';
  65.  
  66.  
  67.     // frame2
  68.     echo outDivFrame('frame2');
  69.     echo outFrameHeaderTable('frame2Header','2',$tx);
  70.     echo 'This is a sample page for '.$_GET['theme'].' theme'.outButton('Button',false,false,false,false,'style="margin-left:1em"').'<br>';
  71.     // frame3
  72.     echo outDivFrame('frame3');
  73.     echo outFrameHeaderTable('frame3Header','3',$tx);
  74.     echo 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit. '.outButton('Button',false,false,false,false,'style="margin-left:1em"').'<br>';    echo outFrameFooterTable('frame3Footer',$gr.$_GET['theme'],$tx);
  75.     echo '</div>';
  76.  
  77.     // frame3
  78.     echo outDivFrame('frame3');
  79.     echo outFrameHeaderTable('frame3Header','3',$tx);
  80.     echo 'This is a sample page for '.$_GET['theme'].' theme'.outButton('Button',false,false,false,false,'style="margin-left:1em"').'<br>';
  81.     echo ' Donec dolor. Praesent non sapien. Suspendisse ac urna. Integer eget mi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec ultricies. Etiam volutpat eleifend enim. Mauris at quam. Phasellus lacinia.';
  82.     echo '</div>';
  83.     // ETC table
  84.     echo outTableTransparent('frame1',false,'cellspacing="20"');
  85.     for($i=1;$i<6;$i++){
  86.         $del='td';
  87.         echo '<tr class="eTC'.(($i%2)?' even':'').'" eH=1 id="t'.$i.'"><'.$del.' class="eTCLeft" style="text-align:left">'.outImage(outIcon('add'), false,false,'vertical-align:middle; padding:2px; margin-right:1em').'</'.$del.'><'.$del.'>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </'.$del.'><'.$del.' class="eTCRight" style="text-align:right">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. </'.$del.'></tr>';
  88.     }
  89.     echo '</table><br/>';
  90.  
  91.     echo outFrameFooterTable('frame2Footer','2',$tx);
  92.     echo '</div>';
  93.  
  94.     echo outFrameFooterTable('frame1Footer','1',$tx);
  95.     echo '</div>';
  96.     outFrameShadowAfter();
  97.  
  98.     echo '<br>';
  99.  
  100.     $_SESSION['lng']['genTheme']="Theme";
  101.     echo themeSelectionControl($_GET['theme']);
  102. ?>
  103.